#include "calc.h"
#define BUFFSIZE 10
int buffp = 0;
int buff[BUFFSIZE];

int getch(FILE *fp) {

	if (buffp > 0)
		return buff[--buffp];
	return getc(fp);
}
void ungetch(int in) {
	if (buffp >= BUFFSIZE) {
		printf("error,too many character\n");
		return;
	}
	buff[buffp++] = in;
}
